package com.wenlin.myproduction.bean;

import android.graphics.drawable.Drawable;

import com.google.gson.annotations.Expose;

import java.io.Serializable;
import java.util.Objects;

public class VersionModel implements Serializable {
    @Expose
    public String PackageName;//应用包名
    @Expose
    public String FileUrl;//应用地址
    @Expose
    public String CipherFileUrl;//加密地址
    @Expose
    public String SavePath;//应用下载保存地址
    @Expose
    public boolean IsMandatory;//是否强制更新
    @Expose
    public boolean IsUpdate;//是否更新
    @Expose
    public String Descript;//更新说明
    @Expose
    public String VersionCode;//版本code
    @Expose
    public String VersionName;//版本名称
    @Expose
    public String AppName;//app名称
    @Expose
    public AppState mAppState = VersionModel.AppState.None;
    @Expose
    public Drawable AppIcon;//本地ICON
    @Expose
    public String AppLogo;//服务端ICON图标地址
    @Expose
    public int AppType;//应用类型 (0 主应用 1内置 2 第三方）
    @Expose
    public boolean DeleteEnable = true;//是否可删除

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        VersionModel that = (VersionModel) o;
        return PackageName.equals(that.PackageName);
    }

    @Override
    public int hashCode() {
        return Objects.hash(PackageName);
    }

    //应用状态
    public enum AppState{
        None,Installed,Update,WaitingToDownload,Downloading,Installing
    }
}
